package com.minimalist.common.entity.tc.entity.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;
import java.util.Objects;

import java.io.Serial;
import java.io.Serializable;

/**
 * 停车车牌表 实体类。
 *
 * @author 11987
 * @since 2025-04-07
 */
@Table(value = "TC_PLATE_NUMBER", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class TcPlateNumber extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 车牌ID
     */
    private Long plateNumberId;

    /**
     * 车牌名称
     */
    private String plateNumberName;

    /**
     * 车型名称
     */
    private String vehicleModel;

    /**
     * 文件ID
     */
    private Long fileId;

    /**
     * 识别结果
     */
    private String identifyResult;

    public TcPlateNumber() {
    }

    public TcPlateNumber(Long plateNumberId, String plateNumberName, String vehicleModel, Long fileId, String identifyResult) {
        this.plateNumberId = plateNumberId;
        this.plateNumberName = plateNumberName;
        this.vehicleModel = vehicleModel;
        this.fileId = fileId;
        this.identifyResult = identifyResult;
    }

    public Long getPlateNumberId() {
        return plateNumberId;
    }

    public void setPlateNumberId(Long plateNumberId) {
        this.plateNumberId = plateNumberId;
    }

    public String getPlateNumberName() {
        return plateNumberName;
    }

    public void setPlateNumberName(String plateNumberName) {
        this.plateNumberName = plateNumberName;
    }

    public String getVehicleModel() {
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel) {
        this.vehicleModel = vehicleModel;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getIdentifyResult() {
        return identifyResult;
    }

    public void setIdentifyResult(String identifyResult) {
        this.identifyResult = identifyResult;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        TcPlateNumber that = (TcPlateNumber) o;
        return Objects.equals(plateNumberId, that.plateNumberId) &&
               Objects.equals(plateNumberName, that.plateNumberName) &&
               Objects.equals(vehicleModel, that.vehicleModel) &&
               Objects.equals(fileId, that.fileId) &&
               Objects.equals(identifyResult, that.identifyResult);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), plateNumberId, plateNumberName, vehicleModel, fileId, identifyResult);
    }

    @Override
    public String toString() {
        return "TcPlateNumber{" +
               "plateNumberId=" + plateNumberId +
               ", plateNumberName='" + plateNumberName + '\'' +
               ", vehicleModel='" + vehicleModel + '\'' +
               ", fileId=" + fileId +
               ", identifyResult='" + identifyResult + '\'' +
               "} " + super.toString();
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long plateNumberId;
        private String plateNumberName;
        private String vehicleModel;
        private Long fileId;
        private String identifyResult;

        public Builder plateNumberId(Long plateNumberId) {
            this.plateNumberId = plateNumberId;
            return this;
        }

        public Builder plateNumberName(String plateNumberName) {
            this.plateNumberName = plateNumberName;
            return this;
        }

        public Builder vehicleModel(String vehicleModel) {
            this.vehicleModel = vehicleModel;
            return this;
        }

        public Builder fileId(Long fileId) {
            this.fileId = fileId;
            return this;
        }

        public Builder identifyResult(String identifyResult) {
            this.identifyResult = identifyResult;
            return this;
        }

        public TcPlateNumber build() {
            return new TcPlateNumber(plateNumberId, plateNumberName, vehicleModel, fileId, identifyResult);
        }
    }
}
